package com.honglv.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.honglv.pojo.entity.Commodities;
import com.honglv.pojo.entity.Food;
import com.honglv.pojo.dto.UpdateFoodDTO;
import com.honglv.pojo.result.Result;
import com.honglv.pojo.vo.GetAllFoodsVO;
import com.honglv.pojo.vo.GetFoodVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface FoodMapper extends BaseMapper<Food> {
    GetFoodVO getFood(@Param("id") Long id);

    List<GetAllFoodsVO> getAllFoods();

    List<GetAllFoodsVO> getFoodsByAuthorId(@Param("userId") Long userId);

    @Delete("DELETE FROM tb_food WHERE id = #{id}")
    int deleteFood(Long id);

    Integer updateFood(UpdateFoodDTO updateFoodDTO);
}
